import { createApp } from 'vue'
//引入element-plus插件与样式
import ElementPlus from 'element-plus'
//@ts-ignore忽略当前文件ts类型的检测否则有红色提示(打包会失败)
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'
import App from './App.vue'
import * as echarts from 'echarts';
//引入路由
import router from '@/router'
//引入大仓库
import pinia from './store'
//svg插件配置
import 'virtual:svg-icons-register'
//引入模板的全局样式
import '@/styles/index.scss'
import '@/styles/background-effects.scss'
//引入自定义插件对象：注册整个项目全局组件
import globalComponent from './api/components/index.ts'
import 'element-plus/theme-chalk/dark/css-vars.css'
//引入路由鉴权文件
import './permission.ts'
//引入自定义指令文件
import { isHasButton } from '@/directive/has'
//引入暗黑模式所需样式
import 'element-plus/theme-chalk/dark/css-vars.css'

// 引入播放器

import VueVideoPlayer from '@videojs-player/vue'
import 'video.js/dist/video-js.css'


//获取应用实例对象
const app = createApp(App)
app.use(ElementPlus, {
  locale: zhCn,
})

// 注册播放器

app.use(VueVideoPlayer)

//注册模板路由,在路由配置结束前添加动态路由，防止页面丢失
app.use(router)
//安装仓库
app.use(pinia)
//安装自定义插件
app.use(globalComponent)
app.mount('#app')
isHasButton(app)